{
语法百题 解题报告：
 http://git.oschina.net/et0662/sznoi-grammar/ 
}
var
	a:array[1..100,1..100] of longint;
	n,i,j:integer;
	flag:boolean;
begin
	read(n);
	for i:=1 to n do
	for j:=1 to n do
		read(a[i,j]);
	flag:=true;
	for i:=1 to n do
	begin
		for j:=1 to n do
			if a[i,j]<>a[j,i] then
			begin
				flag:=false;
				break;
			end;
		if not flag then
			break;
	end;
	if flag then
		writeln('Yes!')
	else
		writeln('No!');
end.
